package com.gmail.volodymyrdotsenko.roo.webeasy.scaffold;

import org.springframework.roo.classpath.PhysicalTypeMetadata;
import org.springframework.roo.classpath.details.ClassOrInterfaceTypeDetails;
import org.springframework.roo.classpath.details.annotations.populator.AbstractAnnotationValues;
import org.springframework.roo.classpath.details.annotations.populator.AutoPopulate;
import org.springframework.roo.classpath.details.annotations.populator.AutoPopulationUtils;
import org.springframework.roo.model.JavaType;

public class WebeasyScaffoldAnnotationValues extends AbstractAnnotationValues {

	@AutoPopulate
	JavaType formBackingObject;
	@AutoPopulate
	String path;

	public WebeasyScaffoldAnnotationValues(
			final ClassOrInterfaceTypeDetails governorPhysicalTypeDetails) {

		super(governorPhysicalTypeDetails,
				WebeasyScaffoldMetadata.ROO_ROO_WEBEASY_SCAFFOLD);

		AutoPopulationUtils.populate(this, annotationMetadata);
	}

	/**
	 * Constructor
	 * 
	 * @param governorPhysicalTypeMetadata
	 */
	public WebeasyScaffoldAnnotationValues(
			final PhysicalTypeMetadata governorPhysicalTypeMetadata) {

		super(governorPhysicalTypeMetadata,
				WebeasyScaffoldMetadata.ROO_ROO_WEBEASY_SCAFFOLD);

		AutoPopulationUtils.populate(this, annotationMetadata);
	}

	public JavaType getFormBackingObject() {
		return formBackingObject;
	}

	public String getPath() {
		return path;
	}

	@Override
	public String toString() {
		return "WebeasyScaffoldAnnotationValues [formBackingObject="
				+ formBackingObject + ", path=" + path + "]";
	}
}